﻿using Api.Model.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Api.Common
{
    public static class ExtensionMethods
    {
        public static bool StringNotEmpty(this string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return false;
            }
            return true;
        }
        public static bool StringNotWhiteSpace(this string value)
        {
            if (string.IsNullOrWhiteSpace(value))
            {
                return false;
            }
            return true;
        }
        public static void ValidMenuEnum(this MeunEnum value)
        {
            if (!Enum.IsDefined(typeof(MeunEnum),value))
            {
                throw new UIException("目录不存在！");
            }
        }
    }
}
